*****REPLICATION DOFILE FOR THE ANALYSIS IN KJAERGAARD, METTE, MARTIN BAEKGAARD, AND ULRICH THY JENSEN: THE PSYCHOLOGICAL COSTS OF COPRODUCTION, JPART.

***OPEN REPLICATION DATA***

***Preparing data.

*Self-efficacy questions (see also Table A2).

tab1 Q1114_1-Q1114_4

recode Q1114_1 Q1114_2 Q1114_3 Q1114_4 (6=.)

factor Q1114_1 Q1114_2 Q1114_3 Q1114_4 // 2 is dropped
alpha Q1114_1 Q1114_3 Q1114_4

generate self_efficacy =  (((Q1114_1 + Q1114_3 + Q1114_4)-3)/12)*10 

label var Q1114_1 "Self-efficacy 1: Understand" 
label var Q1114_2 "Self-efficacy 2: Difficult"
label var Q1114_3 "Self-efficacy 3: Qualified"
label var Q1114_4 "Self-efficacy 4: Good job"

*Administrative burden

*Stress (see also Table A3).
recode Q1521_1 Q1521_2 Q1521_3 (6=.)

factor Q1521_1 Q1521_2 Q1521_3
alpha Q1521_1 Q1521_2 Q1521_3

generate stress = (((Q1521_1 + Q1521_2 + Q1521_3)-3)/12)*10 

label var Q1521_1 "Stress 1: Health"
label var Q1521_2 "Stress 2: Mood"
label var Q1521_3 "Stress 3: Cope with"

*Stigma (see also Table A4).
recode Q1521_4 Q1521_5 Q1521_6 Q1521_7 (6=.)

factor Q1521_4 Q1521_5 Q1521_6 Q1521_7
alpha Q1521_4 Q1521_5 Q1521_6 Q1521_7

generate stigma = (((Q1521_4 + Q1521_5 + Q1521_6 + Q1521_7)-4)/16)*10 

label var Q1521_4 "Stigma 1: Look askance"
label var Q1521_5 "Stigma 2: Bad light"
label var Q1521_6 "Stigma 3: Unpleasant to be asked"
label var Q1521_7 "Stigma 4: Unpleasant with bad care"

*Autonomy (see also Table A5).
recode Q2229_1 Q2229_2 Q2229_6 Q2229_7 (6=.)
recode Q2229_7 (1=5) (2=4) (3=3) (4=2) (5=1)

factor Q2229_1 Q2229_2 Q2229_6 Q2229_7 // 6 is dropped
alpha Q2229_1 Q2229_2 Q2229_7

generate autonomy = (((Q2229_1 + Q2229_2 + Q2229_7)-3)/12)*10 

label var Q2229_1 "Autonomy 1: Influence"
label var Q2229_2 "Autonomy 2: Decide"
label var Q2229_6 "Autonomy 3: Intervention"
label var Q2229_7 "Autonomy 4: Pushed"

*Positive items (see also Table A6).
recode Q2229_3 Q2229_4 Q2229_5 (6=.)

factor Q2229_3 Q2229_4 Q2229_5
alpha Q2229_3 Q2229_4 Q2229_5

generate positive = (((Q2229_3 + Q2229_4 + Q2229_5)-3)/12)*10 

label var Q2229_3 "Positive 1: Quality of life"
label var Q2229_4 "Positive 2: Proud"
label var Q2229_5 "Positive 3: Worth the time"

*Standardized versions of items
egen stigma_std = std(stigma)
egen autonomy_std = std(autonomy)
egen stress_std = std(stress)
egen positive_std = std(positive)
egen self_efficacy_std = std(self_efficacy)

*Naming variables
recode SELECTGR (1=1 "Yes") (2=0 "No"), gen(treatment_1) label(treatment_1)
label var treatment_1 "Self-efficacy inducement (yes = 1)"

recode SELECTG0 (1=1 "Relative") (2=0 "Volunteer"), gen(treatment_2) label(treatment_2)
label var treatment_2 "Coproduction initiative (relative = 1)"

label var stigma "Stigma 0-10"
label var autonomy "Autonomy 0-10"
label var stress "Stress 0-10" 
label var positive "Positive 0-10"
label var self_efficacy "Self-efficacy 0-10"

label var stigma_std "Stigma std"
label var autonomy_std "Autonomy std"
label var stress_std "Stress std"
label var positive_std "Positive std"
label var self_efficacy_std "Self-efficacy std"

***Covariates

recode GENDER (2=0) // woman = 1
recode Q3 (1=0) (2=0) (3=0) (4=0) (5=1) (6=1) (7=1) (8=.) // Long education = 1
recode REGIONDK (1=1) (2=1) (3=0) (4=0) (5=0) // Zealand and the capital area vs. remainder of Denmark
rename ALDER AGE
replace AGE = AGE + 17
recode Q5 (2=0)

label var GENDER "Gender (female = 1)"
label var Q3 "Education (higher education = 1)"
label var AGE "Age (years)"
label var REGIONDK "Region (Zealand = 1)"
label var Q5 "Parent 65+ years = 1"

gen a = 1 if Q7 == 1
gen b = 1 if Q8 == 3
gen c = 1 if Q9 == 2
gen d = 1 if Q10 == 4
replace a = 0 if a == .
replace b = 0 if b == .
replace c = 0 if c == .
replace d = 0 if d == .
gen correctresponses = a + b + c + d
sum correctresponses
drop a b c d

*Experience with helping others.
egen n_helped = anycount(Q6_02 Q6_03 Q6_04 Q6_05 Q6_06 Q6_07 Q6_08), values(1)
tab n_helped
gen helped_dik = .
replace helped_dik = 0 if n_helped==0
replace helped_dik = 1 if n_helped==1 | n_helped==2 | n_helped==3 | n_helped==4 | n_helped==5 | n_helped==6 | n_helped==7

label var correctresponses "Number of correct answers"
label var helped_dik "Experience with helping relatives"

***Balance test across experimental groups (Table 2)

*Generating variable that identifies the four experimental groups
gen treatment_total =.
replace treatment_total = 1 if treatment_1==0 & treatment_2==0
replace treatment_total = 2 if treatment_1==0 & treatment_2==1
replace treatment_total = 3 if treatment_1==1 & treatment_2==0
replace treatment_total = 4 if treatment_1==1 & treatment_2==1

bysort treatment_total: sum AGE
bysort treatment_total: sum GENDER
bysort treatment_total: sum Q3
bysort treatment_total: sum REGIONDK
bysort treatment_total: sum Q5
bysort treatment_total: sum correctresponses
bysort treatment_total: sum helped_dik

eststo clear
sort treatment_total 
by treatment_total: eststo: quietly estpost sum AGE GENDER Q3 REGIONDK correctresponses helped_dik
esttab using Balancetest.rtf, cells("mean(fmt(2) label(mean))") label nodepvar unstack not noobs title(Table X. Balance test between groups in survey experiment) addnote(Note: Columns 1-4 reports means from each of the treatment groups. Column 5 report results from F-tests of the treatment indicators being jointly zero.*** p<0.001, ** p<0.01, * p<0.05, + p<0.10) 

*Test of statistical significance (t-test and F-test)
foreach y of varlist AGE GENDER Q3 REGIONDK correctresponses helped_dik {
reg `y' i.treatment_total
testparm i.treatment_total 
}

***Descriptive statistics for the dependent variables (Table 3)

sum stigma stress autonomy positive

***Distributions of Dependent variables (Figure 3)

histogram stigma, discrete percent gap(0) xtitle(Stigma) scheme(s2mono) normal
graph save a1, replace
histogram stress, discrete percent gap(0) xtitle(Stress) scheme(s2mono) normal
graph save a2, replace
histogram autonomy, discrete percent gap(0) xtitle(Autonomy) scheme(s2mono) normal
graph save a3, replace
histogram positive, discrete percent gap(0) xtitle(Positive feelings) scheme(s2mono) normal
graph save a4, replace

graph combine a1.gph a2.gph a3.gph a4.gph

***Average treatment effects (Figure 4)

mat eksperiment=J(8,3,.)

reg stigma treatment_2, robust
matrix t1 = r(table)'
matrix eksperiment [1,1] =t1[1,1] 
matrix eksperiment [1,2] =t1[1,5] 
matrix eksperiment [1,3] =t1[1,6]

reg stress treatment_2, robust
matrix t1 = r(table)'
matrix eksperiment [2,1] =t1[1,1] 
matrix eksperiment [2,2] =t1[1,5] 
matrix eksperiment [2,3] =t1[1,6]

reg autonomy treatment_2, robust
matrix t1 = r(table)'
matrix eksperiment [3,1] =t1[1,1] 
matrix eksperiment [3,2] =t1[1,5] 
matrix eksperiment [3,3] =t1[1,6]

reg positive treatment_2, robust
matrix t1 = r(table)'
matrix eksperiment [4,1] =t1[1,1] 
matrix eksperiment [4,2] =t1[1,5] 
matrix eksperiment [4,3] =t1[1,6]

reg stigma treatment_1, robust
matrix t1 = r(table)'
matrix eksperiment [5,1] =t1[1,1] 
matrix eksperiment [5,2] =t1[1,5] 
matrix eksperiment [5,3] =t1[1,6]

reg stress treatment_1, robust
matrix t1 = r(table)'
matrix eksperiment [6,1] =t1[1,1] 
matrix eksperiment [6,2] =t1[1,5] 
matrix eksperiment [6,3] =t1[1,6]

reg autonomy treatment_1, robust
matrix t1 = r(table)'
matrix eksperiment [7,1] =t1[1,1] 
matrix eksperiment [7,2] =t1[1,5] 
matrix eksperiment [7,3] =t1[1,6]

reg positive treatment_1, robust
matrix t1 = r(table)'
matrix eksperiment [8,1] =t1[1,1] 
matrix eksperiment [8,2] =t1[1,5] 
matrix eksperiment [8,3] =t1[1,6]

matrix rownames eksperiment = 1 2 3 4 5 6 7 8 

coefplot (matrix(eksperiment [.,1]), ci((eksperiment [.,2] eksperiment [.,3]))), byopts(xrescale) ///
headings(1 = "{bf: Coproduction task}" 5 = "{bf: Self-efficacy}" ) ///
coeflabels(1 = "Stigma" 2 = "Stress" 3 = "Autonomy" 4 = "Positive feelings" 5 = "Stigma" 6 = "Stress" 7 = "Autonomy" 8 = "Positive feelings", labgap(4) labsize(medsmall) notick) ///
xline(0, lwidth(vthin) lpattern(dash) lcolor(black)) grid(none) ///
xscale(range(-2(1)2)) xtick(-2(1)2) xlabel(-2(1)2) ///
citop ciopts(recast(rcap)) levels(95) msymbol(o) ///
scheme(s1mono)

***Table A1

reg self_efficacy treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != .
reg self_efficacy treatment_1 GENDER AGE Q3 REGIONDK correctresponses

***Table A7

reg stigma treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg stigma treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg stress treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg stress treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg autonomy treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg autonomy treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg positive treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg positive treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

***Table A8

reg stigma treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg stigma treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg stress treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg stress treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg autonomy treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg autonomy treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg positive treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg positive treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

***ADDITIONAL TESTS MENTIONED (BUT NOT REPORTED IN TABLES) IN THE PAPER

*Testing whether experimental effects on psychological outcomes are contingent on prior experience with helping relatives.

reg stigma c.treatment_2##c.helped_dik 
reg stress c.treatment_2##c.helped_dik 
reg autonomy c.treatment_2##c.helped_dik 
reg positive c.treatment_2##c.helped_dik 

reg stigma c.treatment_2##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg stress c.treatment_2##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg autonomy c.treatment_2##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg positive c.treatment_2##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 

reg stigma c.treatment_1##c.helped_dik 
reg stress c.treatment_1##c.helped_dik 
reg autonomy c.treatment_1##c.helped_dik 
reg positive c.treatment_1##c.helped_dik 

reg stigma c.treatment_1##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg stress c.treatment_1##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg autonomy c.treatment_1##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 
reg positive c.treatment_1##c.helped_dik GENDER AGE Q3 REGIONDK correctresponses 

*Adding the self-efficacy scale to the analysis in Table A8 (in addition to co-variates)

reg stigma treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik self_efficacy
reg stress treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik self_efficacy
reg autonomy treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik self_efficacy
reg positive treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik self_efficacy

*Difference in number of correct responses between high and low self-efficacy treatments.

ttest correctresponses, by(treatment_1) 

*Testing interactions between experimental treatments.

reg stigma c.treatment_1##c.treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg stress c.treatment_1##c.treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg autonomy c.treatment_1##c.treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg positive c.treatment_1##c.treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .

reg stigma c.treatment_1##c.treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik 
reg stress c.treatment_1##c.treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik 
reg autonomy c.treatment_1##c.treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik 
reg positive c.treatment_1##c.treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik 

*Robustness checks using factors scores derived from confirmatory factor analysis
   
sem (Stigf ->  Q1521_4, ) (Stigf ->  Q1521_5, ) (Stigf ->  Q1521_6, ) (Stigf ->  Q1521_7, ), covstruct(_lexogenous, diagonal) standardized latent(Stigf) nocapslatent
estat gof, stats(all) nodescribe
alpha  Q1521_4 Q1521_5 Q1521_6 Q1521_7, item
alpha  Q1521_4 Q1521_5 Q1521_6 Q1521_7, gen (Stigf) min (2)

sem (Stref -> Q1521_1, ) (Stref -> Q1521_2, ) (Stref -> Q1521_3, ) , covstruct(_lexogenous, diagonal) standardized latent(Stref) nocapslatent
estat gof, stats(all) nodescribe
alpha  Q1521_1 Q1521_2 Q1521_3, item
alpha  Q1521_1 Q1521_2 Q1521_3, gen (Stref) min (2)

sem (Autf -> Q2229_1, ) (Autf -> Q2229_2, ) (Autf -> Q2229_6, ) (Autf -> Q2229_7, ), covstruct(_lexogenous, diagonal) standardized latent(Autf) nocapslatent
estat gof, stats(all) nodescribe
alpha  Q2229_1 Q2229_2 Q2229_6 Q2229_7, item
alpha  Q2229_1 Q2229_2 Q2229_6 Q2229_7, gen (Autf) min (2)

sem (Posf ->  Q2229_3, ) (Posf ->  Q2229_4, ) (Posf ->  Q2229_5, ) , covstruct(_lexogenous, diagonal) standardized latent(Posf) nocapslatent
estat gof, stats(all) nodescribe
alpha  Q2229_3 Q2229_4 Q2229_5, item
alpha  Q2229_3 Q2229_4 Q2229_5, gen (Posf) min (2)

reg Stigf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stigf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stref treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stref treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Autf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Autf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Posf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Posf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stigf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stigf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stref treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stref treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Autf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Autf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Posf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Posf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik
   
drop Stigf Stref Autf Posf
   
*Robustness checks using factors scores derived from principal factor analysis

factor Q1521_1 Q1521_2 Q1521_3 
rotate
predict Stref

factor Q1521_4 Q1521_5 Q1521_6 Q1521_7
rotate
predict Stigf

factor Q2229_1 Q2229_2 Q2229_7
rotate
predict Autf

factor Q2229_3 Q2229_4 Q2229_5
rotate
predict Posf

reg Stigf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stigf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stref treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stref treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Autf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Autf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Posf treatment_2 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Posf treatment_2 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stigf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stigf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Stref treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Stref treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Autf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Autf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik

reg Posf treatment_1 if GENDER != . & AGE != . &  Q3 != . & REGIONDK != . & correctresponses != . & helped_dik != .
reg Posf treatment_1 GENDER AGE Q3 REGIONDK correctresponses helped_dik